import './App.scss';
import React from 'react';
import { Switch, Route, BrowserRouter } from 'react-router-dom';
import "./assets/scss/main.scss"
// 引入组件
import Home from './views/Home';
import About from './views/About';
import News from './views/News';
class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  render() {
    return (
      // HashRouter 带#号
      // BrowserRouter 不带#号需要后端处理url指向
      <div className={'test'}>
        <h3>hello world</h3>
      <BrowserRouter>
        <Switch>
          {/* exact精准匹配 */}
          <Route component={Home} exact path="/"></Route>
          <Route component={About} path="/about"></Route>
          <Route component={News} path="/news"></Route>
        </Switch>
      </BrowserRouter>
      </div>
    );
  }
}

export default App;


